﻿namespace KinonekoSoftware.Foundation.UI.Windows.Helpers
{
    public static class ControlHelper
    {
        public static readonly SolidColorBrush Transparent = new SolidColorBrush(Colors.Transparent);

        public static void DrawBackground(FrameworkElement element, DrawingContext context)
        {
            context?.DrawRectangle(Transparent, null, new Rect(0, 0, element.ActualWidth, element.ActualHeight));
        }
        
        public static void DrawBackground(FrameworkElement element, DrawingContext context, SolidColorBrush brush)
        {
            context?.DrawRectangle(brush, null, new Rect(0, 0, element.ActualWidth, element.ActualHeight));
        }
        
        public static void DrawBackground(FrameworkElement element, DrawingContext context, Pen pen)
        {
            context?.DrawRectangle(null, pen, new Rect(0, 0, element.ActualWidth, element.ActualHeight));
        }
        
        public static void DrawBackground(FrameworkElement element, DrawingContext context, SolidColorBrush brush, Pen pen)
        {
            context?.DrawRectangle(brush, pen, new Rect(0, 0, element.ActualWidth, element.ActualHeight));
        }
    }
}